package com.yun.many.auth.dao.enums;

import com.yun.many.dao.enums.IDbEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum SexEnum implements IDbEnum<Integer> {
    MALE(1, "男"),
    FEMALE(2, "女");

    private final Integer value;
    private final String desc;

    public static SexEnum of(Integer value) {
        for (SexEnum sexEnum : values()) {
            if (sexEnum.getValue().equals(value)) {
                return sexEnum;
            }
        }
        return null;
    }
}
